import { Gender, OrderType, Role } from '../client'

export function getGenderColorType(gender: Gender) {
  switch (gender) {
    case Gender.MALE:
      return 'cyan'
    case Gender.FEMALE:
      return 'pink'
    case Gender.OTHER:
      return 'navy'
  }
}

export const genderSelections = [
  {
    label: '男',
    value: Gender.MALE
  },
  {
    label: '女',
    value: Gender.FEMALE
  },
  {
    label: '其他',
    value: Gender.OTHER
  }
]

export function getGenderText(gender: Gender) {
  switch (gender) {
    case Gender.MALE:
      return '男'
    case Gender.FEMALE:
      return '女'
    case Gender.OTHER:
      return '其他'
  }
}

export function getOrderTypeColorType(type: OrderType) {
  switch (type) {
    case OrderType.REWARD:
      return '#F6BEEA'
    case OrderType.NAMING:
      return '#B9A9E4'
    case OrderType.COACH:
      return '#1EB689'
    case OrderType.NONE:
      return undefined
  }
}

export const orderTypeSelections = [
  {
    label: '打赏',
    value: OrderType.REWARD
  },
  {
    label: '冠名',
    value: OrderType.NAMING
  },
  {
    label: '代练',
    value: OrderType.COACH
  },
  {
    label: '无',
    value: OrderType.NONE
  }
]

export function getOrderTypeText(type: OrderType) {
  switch (type) {
    case OrderType.REWARD:
      return '打赏'
    case OrderType.NAMING:
      return '冠名'
    case OrderType.COACH:
      return '代练'
    case OrderType.NONE:
      return '订单'
  }
}

export function getRoleColor(role: Role) {
  switch (role) {
    case Role.ADMIN:
      return 'info'
    case Role.STAFF:
      return 'default'
    case Role.USER:
      return 'default'
    case Role.COPILOT:
      return 'default'
  }
}

export const roleSelections = [
  {
    label: '管理员',
    value: Role.ADMIN
  },
  {
    label: '客服',
    value: Role.STAFF
  }
]

export function getRoleText(role: Role) {
  switch (role) {
    case Role.ADMIN:
      return '管理员'
    case Role.STAFF:
      return '客服'
    case Role.USER:
      return '用户'
    case Role.COPILOT:
      return '陪玩'
  }
}
